package com.itheima.service.db;

import com.itheima.domain.db.*;

import java.util.List;

/**
 * @Autor JiangYunTian
 * @Date 2022/11/10
 * @Function 测灵魂Service接口
 */
public interface TestSoulService {

    //根据用户id查询用户的问卷锁记录
    List<QuestionUserLock> findQuestionUserLockByUserId(Long userId);

    //保存用户的问卷锁记录
    void saveQuestionUserLock(QuestionUserLock questionUserLock);

    //通过问卷id查询问卷属性
    List<Survey> findSurveyBySurveyIdList(List<Long> surveyIdList);

    //根据问卷id查询题目
    List<Questions> findQuestionsBySurveyId(Long surveyId);

    //根据问题id查选项
    List<Options> findOptionsByQuestionsId(Long questionsId);

    //计算得分
    Integer calculateScore(List<Answers> answers);

    //得到问卷id
    Long findSurveyIdByAnswers(List<Answers> answers);

    //通过userId和surveyId查询锁对象
    QuestionUserLock findQuestionUserLockById(Long userId, Long surveyId);

    //保存锁对象
    void updateQuestionUserLock(QuestionUserLock questionUserLock);

    //保存或更新report对象
    Long saveOrUpdateReport(Report report);

    //查询report对象
    Report findReportById(Long reportId);

    //查找分数与用户相似的用户
    List<UserInfo> findSimilarYou(Long surveyId, Integer score);

    //根据用户id查询报告
    Report findReportByUserIdAndSurveyId(Long userId,Long surveyId);
}
